home *** CD-ROM | disk | FTP | other *** search
/ Champak 103 / Vol 103.iso / games / starship.swf / scripts / DefineSprite_101 / frame_1 / DoAction.as
Text File  |  2010-03-13  |  782b  |  43 lines

  1. function init()
  2. {
  3.    var i = 1;
  4.    while(_root.cst.maxObjects >= i)
  5.    {
  6.       tellTarget("../object_" + i)
  7.       {
  8.          _root.temp.objectFrames = _totalframes;
  9.       }
  10.       if(Number(_root.temp.objectFrames) == 0)
  11.       {
  12.          _name = "object_" + i;
  13.          break;
  14.       }
  15.       i++;
  16.    }
  17.    gotoAndStop(1);
  18. }
  19. function hit()
  20. {
  21.    if(active == true)
  22.    {
  23.       _root.temp.monsterId = monster;
  24.       i = 1;
  25.       while(_root.cst.maxMonster >= i)
  26.       {
  27.          tellTarget("../../danger/monster_" + i)
  28.          {
  29.             if(id eq _root.temp.monsterId)
  30.             {
  31.                nextFrame();
  32.             }
  33.          }
  34.          active = false;
  35.          nextFrame();
  36.          i++;
  37.       }
  38.    }
  39. }
  40. active = true;
  41. stop();
  42. init();
  43.